// load the atlas image

// parse the relevant JSON file

// load the map image

// parse the map's JSON file


// using XHR to load image data into a buffer:
var req = new XMLHttpRequest();
req.open("GET", "http://www.google.com/images/logos/ps_logo2.png", false);//some_binary_file.ext
req.responseType = "arraybuffer"; req.send();
var builder = new BlobBuilder();
builder.append(req.response);
var blob = builder.getBlob("image/png");

// Then you can do whatever you want with the blob (use the FileWriter and the file system API, for example).



// slicing a buffer array

var buffer = new ArrayBuffer(12);
var x = new Int32Array(buffer);
x[1] = 1234;
var slice = buffer.slice(4);
var y = new Int32Array(slice);
console.log(x[1]);      // 1234
console.log(y[0]);      // 1234
x[1] = 6789;
console.log(x[1]);      // 6789
console.log(y[0]);      // 1234
